home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / newsltr / newslttr.lha / Newsletter5 < prev   
Text File  |  1980-02-08  |  16KB  |  427 lines

  1.  
  2.                    HDF Newsletter #5
  3.  
  4. Contents:
  5.  
  6.    To transpose or not to transpose? (We need your help)
  7.  
  8.    HDF 3.2 beta
  9.     A. How HDF 3.2 is different from HDF 3.1
  10.       1. SDS enhancements
  11.       2. New conversion routines
  12.       3. Complete new set of general purpose routines.
  13.       4. Emulation of previous general purpose interface
  14.       5. Inclusion of the Vset calling interface
  15.       6. Test modules.
  16.       7. Naming conventions
  17.     B. Getting HDF 3.2 beta
  18.     C. Work to do, problems to solve, and things to decide
  19.  
  20.     Calibration Tag
  21.  
  22. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  23.  
  24.                To transpose or not to transpose?
  25.                      (We need your help)
  26.  
  27. Background
  28.  
  29. HDF3.1 release 5 and earlier releases store SDS arrays in HDF 
  30. files in "row major order" by default.  ("Row major order" 
  31. refers to the fact that two-dimensional arrays are stored "a 
  32. row at a time," each row occupying a contiguous block of 
  33. storage.)  The C language follows this convention in its 
  34. internal storage of arrays as well, which means that a C call 
  35. to an HDF SDS routine like DFSDadddata simply streams the 
  36. data as is to the HDF file.
  37.  
  38. But Fortran does not follow this convention in its internal 
  39. storage of arrays.  Fortran stores arrays in "column major 
  40. order."  When a Fortran program calls DFSDputdata to write an 
  41. array to an HDF file the data must be transposed.   
  42. Similarly, when a Fortran program calls DFSDgetdata, it 
  43. transposes the data so that it is stored in the original 
  44. order.
  45.  
  46. This approach seemed reasonable when we first designed the 
  47. SDS interface, because it was a way of keeping rows and 
  48. columns consistent, no matter which language was used.  But, 
  49. as many users have suggested, this was not always true, 
  50. especially when arrays of higher dimension were involved.  By 
  51. second-guessing how users "view" arrays, HDF often imposes an 
  52. order on them that is not intended.  Furthermore, when higher 
  53. dimensions are involved, transposing can rearrange data in 
  54. ways that make it very hard for a user to understand it.
  55.  
  56. A second problem caused by transposing data is that it takes 
  57. time.  TFor large data sets this slows down reading and 
  58. writing substantially.  Some HDF users have found that they 
  59. must turn off transposing because they simply cannot tolerate 
  60. the additional time it takes.
  61.  
  62. The proposed change
  63.  
  64. In a nutshell, we are proposing that the SDS interface no 
  65. longer transpose arrays that are read from or written to HDF 
  66. files by Fortran programs. 
  67.  
  68. The main negative implication to this, we believe, is that 
  69. some older programs assume transposing and have code to 
  70. accommodate for it, and these programs will have to be 
  71. revised.  The positive implications are (1) that users know 
  72. that what goes into an HDF file maps directly to what they 
  73. have stored in memory, and (2) perfomance for large datasets 
  74. is improved enormously.
  75.  
  76.  
  77. What we need from you
  78.  
  79. Let us know if you care about this issue one way or the 
  80. other.  If you want to play with a version of HDF that does 
  81. not transpose, get the file README.notranspose in 
  82. outgoing/hdf3.2 on the ftp server (ftp.ncsa.uiuc.edu; IP 
  83. address 141.142.20.50).
  84.  
  85. We plan to wait and see what the reaction is from our users, 
  86. and then we will decide whether to make this important 
  87. change.  Our schedule calls for us to release HDF 3.2 in May 
  88. sometime, and we might want to make the change with that 
  89. release, if we make it.  So let us know within the next few 
  90. weeks if you have an opinion about it.
  91.  
  92.  
  93. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  94.  
  95.  
  96.                   HDF 3.2 beta 
  97.  
  98. On March 1, we put a new version of HDF on the ftp server 
  99. (ftp.ncsa.uiuc.edu; IP address 141.142.20.50) in the 
  100. directory HDF/HDF3.2beta.  This version is a result of a 
  101. joint software development effort between NCSA and the 
  102. Information Technologies Institute of Singapore, with a lot 
  103. of additional support from Phillips Petroleum.  It represents 
  104. a major overhaul of HDF, and gives a good foundation for 
  105. future HDF development.
  106.  
  107. We are working towards a full release of HDF 3.2 sometime in 
  108. May.  The beta release has been implemented so far only on 
  109. the Cray, Sun (SPARC), and Decstation 5000.  We expect to 
  110. have it ported to the other platforms by the time of the full 
  111. release.
  112.  
  113. PLEASE, ALL YOU ADVENTUROUS SOULS, GRAB IT AND PLAY WITH IT, 
  114. AND LET US KNOW WHAT NEEDS FIXING.  Shiming Xu will be our 
  115. contact person for this: sxu@ncsa.uiuc.edu (217) 244-3830.
  116.  
  117.  
  118. A. How HDF 3.2 is different from HDF 3.1
  119. ----------------------------------------
  120.  
  121. A1. SDS enhancements.
  122.  
  123. The previous SDS interfaces allow storage of 32-bit floats 
  124. and Cray native mode floats only.  The HDF 3.2 SDS interface 
  125. has been expanded to handle  8-bit, 16- bit, and 32-bit 
  126. integers, 32-bit and 64-bit floats, and native mode for all 
  127. of these..  In this beta version, 64-bit floats have not yet 
  128. been tested, but they should be done by the full release.
  129.  
  130. In the C interface, integers can be signed or unsigned.  In 
  131. the FORTRAN interface, there is no distinction, so all 
  132. integers are assumed to be signed.  The names used to 
  133. describe the new data types are
  134.  
  135.     int8        8-bit signed integer
  136.     uint8       8-bit unsigned integer (C only)
  137.     int16      16-bit signed integer
  138.     uint16     16-bit unsigned integer (C only)
  139.     int32      32-bit signed integer
  140.     uint32     32-bit unsigned integer (C only)
  141.     float32    32-bit float
  142.     float64    64-bit float
  143.  
  144.  
  145. To handle the new data types, the DFSDsettype routine has
  146. been replaced by three new routines: DFSDsetNT, DFSDgetNT and
  147. DFSDsetorder.  DFSDsetNT and DFSDsetorder should completely
  148. replace the DFSDsettype routine.
  149.  
  150. DFSDsetNT must be called if a number type other than float32
  151. is to be stored.  For example:
  152.  
  153. C:
  154.       DFSDsetNT(DFNT_INT8);
  155.       DFSDadddata("myfile.hdf", rank, dims, i8data);
  156.  
  157. FORTRAN:
  158.       ret  = dssnt(DFNT_INT8)
  159.       ret = dsadata('myfile.hdf', rank, dims, i8data)
  160.  
  161. Valid parameter values for DFSDsetNT (e.g. DFNT_INT8) are
  162. defined in the file hdf.h.  They are of the general form
  163. "DFNT_<numbertype>", all capital letters.
  164.  
  165. Since, in addition to data, an SDS can contain max/min values 
  166. and scales, these can also contain data types other than 
  167. float32.  Since max/min values are supposed to relate to the 
  168. data itself, it is assumed that the type of max/min is the 
  169. same as the type of the data.  The same is true for scales, 
  170. although eventually an option is planned to allow you to set 
  171. scale number types differently than data number types.
  172.  
  173. DFSDgetNT allows you to query about the number type of the
  174. SDS that is current.  As with other "DFSDget..." routines,
  175. you must call DFSDgetdims, or DFSDgetdata to "move to" a
  176. particular SDS before calling DFSDgetNT.
  177.  
  178. The second routine, DFSDsetorder, can be used to override the
  179. default ordering of data in an SDS.  It works the same as the
  180. previous routine DFSDsettype, with the third parameter set.
  181. For example:
  182.  
  183. C:
  184.       DFSDsetorder(DFO_FORTRAN);
  185.       DFSDadddata("myfile.hdf", rank, dims, i8data);
  186.  
  187. FORTRAN:
  188.  
  189.       ret = dssodr(DFO_FORTRAN)
  190.       ret = dspdata('myfile.hdf', rank, dims, i8data)
  191.  
  192. One result of the "setorder" implementation was the discovery
  193. that the tag that indicates "FORTRAN order" (tag 709) may
  194. appear as an "unknown tag" for some software that has not
  195. been written to expect it.
  196.  
  197. (As indicated in the first part of the newsletter, the HDF 
  198. group is considering dropping the automatic transposition 
  199. of FORTRAN data sets with this release.)
  200.  
  201. In order to support the new number types and at the same time
  202. make it easier to add new features (e.g data compression) to
  203. future versions of SDS, a new structure for the SDG
  204. (scientific data group) and some new tags have been
  205. implemented.  The new structure is called NDG, for "numeric
  206. data group", and has the tag 720.
  207.  
  208. In order to maintain backward compatibility, HDF examines 
  209. each new NDG that it writes to a file to determine whether it 
  210. is backward compatible with the old SDG structure (float32 
  211. data only, etc.), and if it is, writes out an SDG as well as 
  212. an NDG.  A new "link tag" (710) stored in the NDG tells HDF 
  213. that it represents the same SDS as the corresponding SDG.
  214.  
  215.  
  216. A2.  New conversion routines.
  217.  
  218. A completely new, and much more general, scheme is used for
  219. doing conversions.  The same conversion module is now used by
  220. the Vset and SDS interfaces, and the intention is to use this
  221. module for all HDF I/O that requires conversions.
  222.  
  223. The conversion module is intended for use by developers only,
  224. and should not be considered part of an application 
  225. interface.
  226.  
  227.  
  228. A3. Complete new set of general purpose routines.
  229.  
  230. The lower layer of HDF has been completely redesigned and re-
  231. implemented, and all application interfaces, such as RIS8 and
  232. SDS, have been re-implemented on this layer.  The new lower
  233. layer incorporates the following improvements:
  234.  
  235.     - More consistent data and function types are needed.
  236.     - An error handling module that supports more meaningful
  237.       and extensive reporting of errors.
  238.     - Simplification of key lower level functions
  239.     - Simplified techniques for facilitating portability
  240.     - Support for alternate forms of physical storage, such
  241.       as linked blocks storage, and storage of the data
  242.       portion of an object in an external file.
  243.     - A version tag indication which version of the HDF
  244.       library last changed an HDF file.
  245.     - Hooks to support simultaneous access to multiple files
  246.     - Hooks to support simultaneous access to multiple
  247.       objects within a single file.
  248.  
  249. The modules that implement these changes can be found in
  250. files that begin with the letter "h", and each routine begins
  251. with the letter "H" (Hopen, Hclose, Hwrite, etc.).
  252.  
  253. Because of these changes, the names of include files are
  254. different.  Where you included df.h previously, you
  255. should now include hdf.h.  Also, the number and names
  256. of basic modules has changed, and now include:
  257.  
  258.     hfile.c    basic i/0
  259.     herr.c     error-handling
  260.     hkit.c     general purpose routines (HDgetspace, etc.)
  261.     hblocks.c  to support linked block physical storage
  262.     hextelt.c  to support external storage of HDF data
  263.  
  264. More details on this new organization will be available 
  265. later.
  266.  
  267.  
  268. A4. Emulation of previous general purpose interface
  269.  
  270. Although the previous general purpose interface has been 
  271. replaced by the new general purpose routines, backward 
  272. compatibility is maintained by a set of routines that emulate 
  273. the old routines.  All of the old routines that begin with 
  274. the letters "DF" (DFopen, DFclose, DFgetelement, etc.) have 
  275. been rewritten on top of the new "H" layers.  Users who 
  276. currently use the "DF" routines should be able to continue to 
  277. use them, although they are encouraged to switch to using the 
  278. new "H" routines as soon as possible.
  279.  
  280.  
  281. A5. Inclusion of the Vset calling interface
  282.  
  283. Previously, the Vset calling interface had its own library.
  284. In HDF 3.2, the Vset calling interface is contained in the
  285. same library as the other HDF interfaces.  As mentioned
  286. previously, the Vset module now uses the new conversion
  287. routines.
  288.  
  289.  
  290. A6. Test modules.
  291.  
  292. In an effort to work towards having an HDF "test suite", a 
  293. number of test modules are included with this release of HDF. 
  294. This test suite is quite incomplete at the moment, but we 
  295. plan to extend it to cover as many routines as possible as 
  296. quickly as possible.
  297.  
  298. The names of the test files are formed by contatenating the 
  299. letter "t", the base name of the interface (e.g. "dfsd"), 
  300. optionally some other descriptive set of characters, and 
  301. either ".c" or ".f", depending on whether they are C or 
  302. FORTRAN programs.  For example, the program "tdfan.c" is a 
  303. test program for the HDF object annotation interface, and 
  304. "tdfanfile.c" is a test program for the HDF file annotation 
  305. interface.
  306.  
  307.  
  308. A7.  Naming conventions
  309.  
  310. We have tried to be more consistent in our naming conventions 
  311. for routines with this release.  Routines in the FORTRAN and 
  312. C applications interfaces begin with one or more capital 
  313. letters, as follows:
  314.  
  315.         DFR8   (8-bit raster image sets)
  316.         DF24   (24-bit raster image sets)
  317.         DFP    (palettes)
  318.         DFSD   (scientific data sets)
  319.         DFAN   (annotations)
  320.         V      (vsets)
  321.  
  322. The lower level routines are categorized as follows:
  323.  
  324.        H...   (new lower level i/o)
  325.        DF...  (emulation of old lower level i/o routines)
  326.        HD...  (lower level utilities for developers)
  327.        HE...  (lower level error-handling)
  328.        HL...  (routines that support linked block storage)
  329.        HX...  (routines that support external elements)
  330.        DFK... (conversion routines)
  331.        H*I... (internal, "private" routines, not guaranteed
  332.                always to exist or to remain the same.  Use
  333.                at your own risk.)
  334.  
  335.  
  336. B. Getting HDF 3.2 beta
  337. -----------------------------
  338. There are four subdirectories under HDF/HDF3.2beta: src, 
  339. tests, examples, and tar.
  340.  
  341.     "src"       contains all source for the beta release, 
  342.     "tests"     contains all of the test programs currently
  343.                 available for the beta release, 
  344.     "examples"  contains the old examples, revised to 
  345.                 work with HDF 3.2, and
  346.     "tar"       contains tar files of the test and src
  347.                 directories.  
  348.  
  349. There is an INSTALL file in the src directory with full 
  350. particulars on installing HDF 3.2 beta.  
  351.  
  352.  
  353. C. Work to do, problems to solve, and things to decide
  354. ------------------------------------------------------
  355.  
  356. The following list is in approximate order of priority and
  357. expected chronological order.
  358.  
  359. The FORTRAN test suite needs to be expanded to cover all
  360. interfaces, then the interfaces need to be tested.  This
  361. means that FORTRAN modules corresponding to the following
  362. must be written: tdfan, tdfanfile, tdfr8, tdfr24, and tdfp,
  363. and tdfstubs.
  364.  
  365. Fortran stubs need to be written for certain H level
  366. routines, such as HEprint, and possibly Hopen, and Hclose.
  367.  
  368. The command line utilities need to be revised.
  369.  
  370. The transpose/no-transpose policy needs to be decided and 
  371. code changed accordingly.
  372.  
  373. Everything needs to be ported to the SGI, IBM RS/6000,
  374. Convex, Mac, and IBM PC.
  375.  
  376. Documentation needs to be revised, including "NCSA HDF
  377. Specifications", "NCSA HDF Calling Interfaces and Utilities",
  378. and "HDF Vset."
  379.  
  380.  
  381. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  382.  
  383.                  Calibration Tag
  384.  
  385. Alban Deniz, an alert HDF user at Naval Research Lab, has 
  386. suggested that we add a "calibration tag", which would be to 
  387. provide information for calibrating the values in an SDS.  
  388. Alban sent suggests the following specification:
  389.  
  390.   SDCAL   Scientific data offset and calibration
  391.           16 bytes
  392.           (731)
  393.  
  394.           This record contains four 32-bit floating point
  395.           values:
  396.  
  397.            cal       calibration factor
  398.            cal_err   absolute error in the calibration factor
  399.            ioff      raw data offset
  400.            ioff_err  rms error in the offset
  401.  
  402. The relationship between a value 'iy' stored in an SDS and 
  403. the actual value would be defined as:
  404.  
  405.     y = cal * (iy - ioff)
  406.  
  407. The variable ioff_err contains the rms error of ioff, and 
  408. cal_err contains the absolute error of cal.
  409.  
  410. Two new routines would be added to the SDS interface:
  411.  
  412.     DFSDgetcal(*cal, *cal_err, *ioff, *ioff_err)
  413.     DFSDsetcal(cal, cal_err, ioff, ioff_err)
  414.  
  415. Alban has been using this tag and these routines for over a 
  416. year with his own personalized version of the HDF library, 
  417. and finds them very useful.  And now that HDF 3.2 provides 
  418. support for small integers in SDS, such a tag seems very 
  419. useful.
  420.  
  421. We would like to add Alban's routines to the SDS interface, 
  422. but first we would like to hear your opinions about it.  Are 
  423. there any changes you would like to see made to it to 
  424. generalize it?
  425.  
  426.  
  427.